Making Endpoint optional on transport options#562
Making Endpoint optional on transport options#562aaronpowell wants to merge 2 commits intomodelcontextprotocol:mainfrom
Conversation
|
Rather than making the Also, while it does demonstrate the motivation for this change, I don't think we're ready to take on the maintenance of a Blazor + Aspire sample. If anything, I'd want to consolidate the samples, but that should be done after discussing what we can combine. |
If that's more viable, then sure.
Totally. I wanted to illustrate with a full e2e sample of what I am trying to do, but to do that it required changes in the underlying library so it was easier to do it in the repo. If this progresses forward, I would radically simplify the sample so there's not so many additional pieces in there. |
|
Thanks for your contribution, but as I mentioned in my last comment, we don't want to maintain another sample for this. This does show there are scenarios where supplying an URL to the transport could be made optional, it's rare, and I think it's better to keep it required for documentation purposes. You can come up with a valid URI if you really need to even with the Aspire scenario. |
Making the
Endpointoptional, and nullable, onSseClientTransportOptionsto better support integration with Aspire.Fixes #515
Motivation and Context
As described in #515, the requirement to provide an
Endpointposes a challenge when working with Aspire, or anything that might want to delegate the endpoint to theHttpClientusing an implementation ofIServiceEndpointProvider.How Has This Been Tested?
I've added a .NET Aspire sample (app host, service defaults and mcp server/client).
Breaking Changes
There's an API breaking change as the
Endpointproperty is now nullable (and notrequired).Types of changes
Checklist
Additional context
I've creating this as a draft PR initially as there's many failing tests, as there's many places we provide an
EndpointandHttpClient, but they don't match addresses, and I'm not sure the role of theHttpClientin those tests.